FROM golang:1.25.0-bookworm

# 设置工作目录
WORKDIR /app

# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download

COPY ../code/* .
RUN go build -v -o /usr/local/bin/app ./...

CMD ["app"]
